import { _decorator, Component, Node, Camera } from "cc";
const { ccclass, property, type } = _decorator;

@ccclass("FollowCamera")
export class FollowCamera extends Component {
  @property
  @type(Camera)
  public camera: Camera;

  start() {}

  update(deltaTime: number) {
    if (this.camera) {
      this.node.setWorldRotation(this.camera.node.getWorldRotation());
    }
  }
}
